package com.zho.common.server;

import javax.servlet.ServletContext;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.context.ServletContextAware;

public class ServerConfigLoader implements InitializingBean, DisposableBean, ServletContextAware {

	public ServerConfigLoader() {
		System.err.println("ServerConfigLoader   ServerConfigLoader   ServerConfigLoader");
	}
    /* 
     * (non-Javadoc)
     * 
     * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
     */
    public void afterPropertiesSet() throws Exception {
        try {
        	System.out.println("Loading server config .... BEGIN");
            System.out.println("Loading server config .... END");
        } catch (Exception e) {
            System.err.println(e.getMessage());
        }
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.springframework.beans.factory.DisposableBean#destroy()
     */
    public void destroy() throws Exception {
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.springframework.web.context.ServletContextAware#setServletContext(javax.servlet.ServletContext)
     */
    public void setServletContext(ServletContext scxt) {
        ServerConfig.setServletContext(scxt);
    }
}
